﻿using MT.WebApi.Core.ConfigureServices;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;

namespace MT.Rest
{
    public class Startup
    {
        public Startup(IConfiguration configuration, IHostingEnvironment env)
        {
            Configuration = configuration;
            this.Configuration = new ConfigurationBuilder()
                .AddJsonFile("Config/appsettings.json")
                .AddEnvironmentVariables()
                .SetBasePath(env.ContentRootPath)
                .Build();
        }
        public IConfiguration Configuration { get; }
        public void ConfigureServices(IServiceCollection services)
        {
            services.Build(Configuration);
       
        }

        public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory, IHttpContextAccessor accessor)
        {
            StartupConfigure.Build(app, env, loggerFactory, accessor);
        }
    }
}